import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [{
        path: "/",
        name: "login",
        component: () =>
            import ("../views/login.vue"),
    },
    {
        path: "/demo",
        name: "demo",
        component: () =>
            import ("../views/demo.vue"),
    },
    {
        path: "/index",
        name: "index",
        redirect: "/home",
        component: () =>
            import ("../views/index.vue"),
        children: [{
                path: "/home",
                name: "home",
                component: () =>
                    import ("../views/task/home.vue"),
            },
            {
                path: "/jiandu",
                name: "jiandu",
                component: () =>
                    import ("../views/task/jiandu.vue"),
            },
            {
                path: "/add_task",
                name: "add_task",
                component: () =>
                    import ("../views/task/add_task.vue"),
            },
            {
                path: "/edit_task",
                name: "edit_task",
                component: () =>
                    import ("../views/task/edit_task.vue"),
            },
            {
                path: "/my_task",
                name: "my_task",
                component: () =>
                    import ("../views/task/my_task.vue"),
            },
            {
                path: "/statistics",
                name: "statistics",
                component: () =>
                    import ("../views/task/statistics.vue"),
            },
            {
                path: "/data",
                name: "data",
                component: () =>
                    import ("../views/task/data.vue"),
            },
            {
                path: "/feedback",
                name: "feedback",
                component: () =>
                    import ("../views/feedback/feedback.vue"),
            },
            {
                path: "/feedlist",
                name: "feedlist",
                component: () =>
                    import ("../views/feedback/feedlist.vue"),
            },
            {
                path: "/news_list",
                name: "news_list",
                component: () =>
                    import ("../views/news/news_list.vue"),
            },
            {
                path: "/add_news",
                name: "add_news",
                component: () =>
                    import ("../views/news/add_news.vue"),
            },
            {
                path: "/edit_news",
                name: "edit_news",
                component: () =>
                    import ("../views/news/edit_news.vue"),
            },
            {
                path: "/user",
                name: "user",
                component: () =>
                    import ("../views/user_center/center.vue"),
            },
            {
                path: "/person",
                name: "person",
                component: () =>
                    import ("../views/user_center/person.vue"),
            },
            {
                path: "/configure",
                name: "configure",
                component: () =>
                    import ("../views/user_center/configure.vue"),
            },
            {
                path: "/subordinate",
                name: "subordinate",
                component: () =>
                    import ("../views/task/subordinate.vue"),
            },

            // 新页面
            {
                path: "/create",
                name: "create",
                component: () =>
                    import ("../views/newLook/create.vue"),
            },
            {
                path: "/myTask",
                name: "myTask",
                component: () =>
                    import ("../views/newLook/myTask.vue"),
            },
            {
                path: "/release",
                name: "release",
                component: () =>
                    import ("../views/newLook/release.vue"),
            },
            {
                path: "/station",
                name: "station",
                component: () =>
                    import ("../views/user_center/station.vue"),
            },
            {
                path: "/bannerpic",
                name: "bannerpic",
                component: () =>
                    import ("../views/user_center/bannerPic.vue"),
            },
        ],
    },
];

const router = new VueRouter({
    // mode: "history",
    base: process.env.BASE_URL,
    routes,
});

export default router;